<?php
require( realpath('..') . '/includes/admin.php' );

auth();
$dora->database();
$dora->lib('freezer');

if( action('update') ) {
	extract($_POST);

	$sql = "update page set name='$name', content='$content' where id=$id";	
	$this->db->query($sql);
	
	$dora->lib('message');
	$dora->message->set('编辑页面成功');
	
	$dora->view('page_fo');
}
else {
	$page_id = $_GET['id'];
	$page = $dora->db->get_result('select * from pages where id=' . $page_id);
	$dora->set('page', $page);
	
	$dora->view('page_update');
}

?>